package main


//继承测试
import (
	"fmt"
)

type student struct{
	name string 
	age int 
	score float64 
}

func (s*student)showInfo(){
	fmt.Printf("name=%v,age=%v,score=%v\n",s.name,s.age,s.score)
}

func (s*student)setscore(score float64){
	s.score=score 
}

type puple struct{
	student 
}
func (s*puple)testing(){
	fmt.Printf("puple testing...")
}

type granduate struct{
	student
}

func (s*granduate)testing(){
	fmt.Printf("granduate testing...")
}
func main(){


	tony:=&puple{}
	tony.student.name="tony"
	tony.student.age=10
	tony.student.score=100.2

	tony.testing()
	tony.student.showInfo()

	tom:=&granduate{}
	tom.student.name="tom"
	tom.student.age=20
	tom.student.score=122.2

	tom.testing()
	tom.student.showInfo()

	tom.name="lucy"
	tom.age=100
	tom.score=11.22
	tom.showInfo()
}